package com.kj.platformlogistics.my.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.kj.platformlogistics.R;
import com.kj.platformlogistics.base.BaseActivity;
import com.kj.platformlogistics.common.UserData;

public class ActivityIdentity extends BaseActivity implements View.OnClickListener {
    private LinearLayout llIdentityInfo,llDriverInfo,llCarInfo;
    private TextView tvUpLoad1;

    public static void actionStart(Context context) {
        Intent intent = new Intent(context, ActivityIdentity.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.llIdentityInfo:
                ActivityIdentityInfo.actionStart(this);
                break;
            case R.id.llDriverInfo:
                ActivityDriverInfo.actionStart(this);
                break;
            case R.id.llCarInfo:
                ActivityCarInfo.actionStart(this);
                break;
        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_identity;
    }

    @Override
    protected void initView() {
        setTitleText("身份认证");
        llIdentityInfo=findViewById(R.id.llIdentityInfo);
        llDriverInfo=findViewById(R.id.llDriverInfo);
        tvUpLoad1=findViewById(R.id.tvUpLoad1);
        llCarInfo=findViewById(R.id.llCarInfo);
        llCarInfo.setOnClickListener(this::onClick);
        llDriverInfo.setOnClickListener(this::onClick);
        llIdentityInfo.setOnClickListener(this::onClick);

        if (UserData.create(ActivityIdentity.this).get(UserData.ROLE).equals("0")){
            //司机
            llDriverInfo.setVisibility(View.VISIBLE);
            llCarInfo.setVisibility(View.VISIBLE);
        }else {
            //分拣员
            llDriverInfo.setVisibility(View.GONE);
            llCarInfo.setVisibility(View.GONE);
        }

       // if (UserData.create(ActivityIdentity.this).get(UserData.driverIdentificationFront))

    }

    @Override
    protected void initData() {

    }


    @Override
    protected int getTitleBarType() {
        return 0;
    }
}
